<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let map1 = new Map();
        // key的值可以是非字符串的类型
        map1.set('name', 'Tom');
        map1.set(1, 'AAA');
        map1.set('1', 'aaa');
        map1.set(true, true);
        map1.set('true', 'true1');
        map1.set('name', 'Tony');
        console.log(map1);
        console.log(map1.get(true));
        console.log(map1.get('true'));
        // 删除
        console.log(map1.delete(1));
        console.log(map1);
        // 是否存在
        console.log(map1.has(1));
        // 全部清空
        // map1.clear();
        // console.log(map1);
        // 遍历
        console.log(map1.keys());
    </script>
</body>

</html>